{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "872e4a4f-e172-4e10-9e12-18d2057028bc",
   "metadata": {
    "tags": []
   },
   "source": [
    "# Chat Engine with a Personality ✨"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9fcf5c89-1972-444b-9607-20cfd4991b3b",
   "metadata": {},
   "source": [
    "## Default"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "43b3edb9-34ff-40fe-aa06-5be75e84726d",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/Users/suo/miniconda3/envs/llama/lib/python3.9/site-packages/deeplake/util/check_latest_version.py:32: UserWarning: A newer version of deeplake (3.6.7) is available. It's recommended that you update to the latest version using `pip install -U deeplake`.\n",
      "  warnings.warn(\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "The Fourth of July is a day to celebrate the beauty of freedom and the power of love.\n"
     ]
    }
   ],
   "source": [
    "from llama_index.chat_engine import SimpleChatEngine\n",
    "\n",
    "chat_engine = SimpleChatEngine.from_defaults()\n",
    "response = chat_engine.chat(\"Say something profound and romantic about fourth of July\")\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c2d61b22-15fb-49e4-abdf-b4bb4c912725",
   "metadata": {
    "tags": []
   },
   "source": [
    "## Shakespeare"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "922652b3-5afd-4365-bc24-aa9a8db24eeb",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "O Fourth of July, a day of joy and mirth,\n",
      "Thou art a day of celebration on this blessed earth.\n",
      "A day of fireworks and revelry,\n",
      "A day of love and unity.\n",
      "Let us all come together and celebrate,\n",
      "For this day of freedom we do celebrate.\n"
     ]
    }
   ],
   "source": [
    "from llama_index.chat_engine import SimpleChatEngine\n",
    "from llama_index.prompts.system import SHAKESPEARE_WRITING_ASSISTANT\n",
    "\n",
    "chat_engine = SimpleChatEngine.from_defaults(\n",
    "    system_prompt=SHAKESPEARE_WRITING_ASSISTANT\n",
    ")\n",
    "response = chat_engine.chat(\"Say something profound and romantic about fourth of July\")\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2294b06b-ea83-460d-8513-158ca8172211",
   "metadata": {},
   "source": [
    "## Marketing"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "595b9b8a-03ee-4df7-a314-108dfabe7a9d",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Fourth of July is a time to celebrate the freedom and independence of our nation. It's a time to reflect on the beauty of our country and the courage of those who fought for our freedom. It's a time to come together and appreciate the beauty of our nation and the people who make it so special.\n"
     ]
    }
   ],
   "source": [
    "from llama_index.chat_engine import SimpleChatEngine\n",
    "from llama_index.prompts.system import MARKETING_WRITING_ASSISTANT\n",
    "\n",
    "chat_engine = SimpleChatEngine.from_defaults(system_prompt=MARKETING_WRITING_ASSISTANT)\n",
    "response = chat_engine.chat(\"Say something profound and romantic about fourth of July\")\n",
    "print(response)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cf1c0f2c-2b47-4523-aa41-4e393203733a",
   "metadata": {},
   "source": [
    "## IRS Tax"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "ae0087e6-9da8-4404-9945-fff449e1a70d",
   "metadata": {
    "tags": []
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " I'm sorry, I can only help with any tax-related questions you may have.\n"
     ]
    }
   ],
   "source": [
    "from llama_index.chat_engine import SimpleChatEngine\n",
    "from llama_index.prompts.system import IRS_TAX_CHATBOT\n",
    "\n",
    "chat_engine = SimpleChatEngine.from_defaults(system_prompt=IRS_TAX_CHATBOT)\n",
    "response = chat_engine.chat(\"Say something profound and romantic about fourth of July\")\n",
    "print(response)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
